<?php $images = $this->product->getImages() ?>

<div id="prd-gallery-image">
<?php foreach($images AS $index=>$image): ?>
	<img id="product-image" src="<?php echo $this->productImagePath('l') . $image->getFileName() ?>" alt="" />
	<input id="imageId" type="hidden" name="imageId" value="<?php echo $image->getId() ?>" />
	<?php break; ?>
<?php endforeach; ?>
</div>

<div id="prd-gallery-thumbnails">
<?php if($images->count() > 1): ?>
	<div class="image-browser">
	<?php foreach($images AS $index=>$image): ?>
		<?php $class = empty($index) ? 'class="selected"' : '' ?>
		<img id="imageid-<?php echo $image->getId() ?>" <?php echo $class ?> src="<?php echo $this->productImagePath('m') . $image->getFileName() ?>" height="50" alt="" />
	<?php endforeach; ?>
	</div>
<?php endif; ?>
</div>